<?php /* Smarty version Smarty-3.1.18, created on 2014-06-08 13:46:13
         compiled from ".\templates\article.tpl" */ ?>
<?php /*%%SmartyHeaderCode:2082253946925b1b4c1-48331153%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'a258164b56a279caa5204f5d224599d31ab77a07' => 
    array (
      0 => '.\\templates\\article.tpl',
      1 => 1401951329,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2082253946925b1b4c1-48331153',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'row' => 0,
    'per' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_53946925eb9670_15243850',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_53946925eb9670_15243850')) {function content_53946925eb9670_15243850($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, null, array(), 0);?>

		<div id="page">
			<div id="header">
				<a href="#menu"></a>
				<?php echo $_smarty_tpl->tpl_vars['row']->value['title'];?>
 - CountSheep
			</div>
			<div id="content">
			   <div id="articlebox">
			        <p><a href="#" id="goback" style="text-decoration:none;font-weight:bold;color:#1d953f;font-size:12px;"><< 返回</a></p>
					<p><img src="<?php echo $_smarty_tpl->tpl_vars['row']->value['image'];?>
" width="330px" height="200px" /></p>
			        <h1><?php echo $_smarty_tpl->tpl_vars['row']->value['title'];?>
</h1>	
			        <div id="article"><?php echo $_smarty_tpl->tpl_vars['row']->value['content'];?>
</div>
					
                    <?php if ($_smarty_tpl->tpl_vars['row']->value['cid']=='7') {?>
                    <?php } else { ?>			        
					<p style="float:right"><?php echo $_smarty_tpl->tpl_vars['row']->value['addDate'];?>
</p>
                    <?php }?>


                    <?php if ($_smarty_tpl->tpl_vars['row']->value['cid']=='7') {?>
                    <?php } else { ?>
					<div id="addComment">
		           	   <p class="cTitle">评论</p>
					   <div class="cContent">
                       <form id="cForm">
                            <textarea style="resize:none;width:80%;float:left" rows=3 name="details" id="details"></textarea>
							<input type="hidden" name="aid" id="aid" value="<?php echo $_smarty_tpl->tpl_vars['row']->value['id'];?>
" />
					        <input type="submit" name="submit" value="提交" style="border:0;height:45px;line-height:45px;margin:5px 0 0 10px;background:#1d953f;color:#fff;" />
					   </form>
					   </div>
			        </div>
                    <?php }?>
                    
					<div id="comment">
					    <?php if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['s'])) unset($_smarty_tpl->tpl_vars['smarty']->value['section']['s']);
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['name'] = 's';
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['loop'] = is_array($_loop=$_smarty_tpl->tpl_vars['per']->value) ? count($_loop) : max(0, (int) $_loop); unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['loop']-1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['show']) {
    $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['loop'];
    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['total'] == 0)
        $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['show'] = false;
} else
    $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['total'] = 0;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['show']):

            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration'] = 1;
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['total'];
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration']++):
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['first']      = ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration'] == 1);
$_smarty_tpl->tpl_vars['smarty']->value['section']['s']['last']       = ($_smarty_tpl->tpl_vars['smarty']->value['section']['s']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['s']['total']);
?>
					     <div class="box">
                              <p>游客: <?php echo $_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['details'];?>
&nbsp;&nbsp;&nbsp;&nbsp;(<?php echo $_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['d_time'];?>
)</p>
							  <?php if ($_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['reply']=='') {?>
							  <p>博主还未回复</p>
							  <?php } else { ?>
						      <p>G.J: <?php echo $_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['reply'];?>
&nbsp;&nbsp;&nbsp;&nbsp;(<?php echo $_smarty_tpl->tpl_vars['per']->value[$_smarty_tpl->getVariable('smarty')->value['section']['s']['index']]['r_time'];?>
)</p>
							  <?php }?>
						 </div>
						 <?php endfor; endif; ?>
					</div>
                </div>				
			</div>
			<nav id="menu">
				<ul>
					<li><a href="index.php">首页</a></li>
					<li><a href="web.php?cid=1">HTML / HTML5</a></li>
					<li><a href="web.php?cid=2">CSS （层叠样式表）</a></li>
					<li><a href="web.php?cid=3">JavaScript / jQuery</a></li>
					<li><a href="web.php?cid=4">随笔</a></li>
					<li><a href="web.php?cid=5">转载</a></li>
					<li><a href="web.php?cid=6">笑话集</a></li>
					<li><a href="message.php">留言板</a></li>
					<li><a href="about.php">关于博主</a></li>
				</ul>
			</nav>
		</div>
<script type="text/javascript">
			$(function() {
				$('nav#menu').mmenu();

				$('#goback').bind('click',function(){
				        window.location.href = 'index.php';
				});
				$('input[type=submit]').bind('click',function(){
					    if($('#details').val().replace(/(^\s*)|(\s*$)/g,'').length < 5){
						      alert('评论不得少于5个字符');
						}else{
						      $('#cForm').attr('method','post');
						      $.post('./comment.php',$('#cForm').serialize(),function(data){
							        if(data){
										   alert('评论成功！');
									       window.location.reload();
									}else{
									       alert('评论失败！');
									}
							  });
						}
						return false;
					});
			});
</script>
<?php echo $_smarty_tpl->getSubTemplate ("footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, null, array(), 0);?>

<?php }} ?>
